<template>
<ul class="nowplayy" >
   
      <li v-for="item in nowplayy">
        <router-link :to="{name:'detail',params:{'id':item.id}}">
        <div class="film-item">
          <div class="film-item-img">
            <div class="img-responsive">
              <img :src="item.poster.origin" />
            </div>
          </div>
          <div class="film-desc">
            <div class="film-next-arrow">></div>
            <div class="film-grade">{{item.grade}}</div>
            <div class="film-name">{{item.name}}</div>
            <div class="film-intro">{{item.intro}}</div>
            <div class="film-counts"><span>{{item.cinemaCount}}</span>家影院上映&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>{{item.watchCount}}</span>人购票  </div>
          </div>
        </div>
        </router-link>
      </li>
  </ul>
</template>
<script>
import $ from 'jquery';
export default {
  data(){
      return{
         nowplayy:[]
      }
  },
   mounted:function(){
        var url = 'http://localhost:3000/nowplaying?time=' + new Date().getTime() + '&page=1&count=9';
        var that = this;
        $.get(url).then(function(res){
            that.nowplayy = res.data.films;
            

        })
    }
}
</script>
<style>
ul,li{
  list-style:none;
}
.film-item{
   width: 100%;
    padding: 20px 0;
    border-bottom: dashed 1px #c9c9c9;
    cursor: pointer;
}
.film-item-img{
  width: 60px;
    float: left;
    overflow: hidden;

}
.film-item-img img{
  width: 100%;
    transition: all 1.2s ease;
    opacity: 1;
        vertical-align: middle;
        border: 0;
        box-sizing: border-box;

}
    
.img-responsive{
  display: block;
    max-width: 100%;
    height: auto;
}
.film-desc{
    padding-left: 15px;
    display: inline-block;
    width: 75%;
}
.film-next-arrow{
      float: right;
    line-height: 29px;
    color: #c6c6c6;
}
.film-grade{
      float: right;
    font-size: 16px;
    line-height: 32px;
    color: #fc7103;
}
.film-name{
      font-size: 16px;
    line-height: 32px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.film-intro{
  height: 24px;
    line-height: 24px;
    color: #8e8e8e;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    display: inline-block;
}
.film-counts{
      line-height: 24px;
    color: #8e8e8e;
    font-size: 12px;
}
.film-counts span{
  color: #8aa2bf;
}
</style>

